import { ViewProps } from "@tarojs/components";
import { PropsWithChildren } from "react";
import { WrappingText } from "@/components";
import "./index.scss";

interface TitleProps extends ViewProps {
  noSpacing?: boolean;
}

const Title = ({
  className,
  children,
  noSpacing = false,
  ...props
}: PropsWithChildren<TitleProps>) => {
  return (
    <WrappingText
      className={`${className ?? ""} title ${noSpacing ? "no-spacing" : null}`}
      {...props}
    >
      {children}
    </WrappingText>
  );
};

export default Title;
